<html>
<head><meta charset="utf-8"><title>Missing tracing subtrees? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html">Missing tracing subtrees?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="228519680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228519680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228519680">(Mar 03 2021 at 01:37)</a>:</h4>
<p>So, has anyone run into issues with subtrees in logging being missing when debugging?<br>
For example, I have this</p>
<div class="codehilite"><pre><span></span><code>    #[tracing::instrument(level = &quot;debug&quot;, skip(self))]
    pub fn ast_region_to_region(
        &amp;self,
        lifetime: &amp;hir::Lifetime,
        def: Option&lt;&amp;ty::GenericParamDef&gt;,
    ) -&gt; ty::Region&lt;&#39;tcx&gt; {
        dbg!(&amp;lifetime);
        ...
</code></pre></div>
<p>With <code>RUSTC_LOG=debug</code>, I see<br>
<code>[compiler/rustc_typeck/src/astconv/mod.rs:207] &amp;lifetime = lifetime(HirId { owner: DefId(0:3 ~ min[317d]::C::{opaque#0}), local_id: 3 }: 'static)</code><br>
without something like<br>
<code>rustc_typeck::astconv::ast_region_to_region lifetime=lifetime(HirId { owner: DefId(0:4 ~ min[317d]::f3), local_id: 6 }: 'static), def=None</code><br>
before.</p>
<p>Note, I see that <code>ast_region_to_region</code> subtree <em>elsewhere</em> in the log. There are other functions in the call stack that aren't displayed either.</p>
<p>I also don't see it with <code>RUSTC_LOG=trace</code>. I'm pretty sure I've seen this before, but I don't know if it's something I'm doing.</p>



<a name="228597187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228597187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tm <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228597187">(Mar 03 2021 at 14:10)</a>:</h4>
<p>Hmm, <code>s/dbg!/debug!/</code>?</p>



<a name="228618583"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228618583" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228618583">(Mar 03 2021 at 16:10)</a>:</h4>
<p>That's what I'm saying: <code>debug</code> calls, <code>instrument</code>, etc. don't show up. <code>dbg</code> does though</p>



<a name="228618687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228618687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228618687">(Mar 03 2021 at 16:11)</a>:</h4>
<p>are you sure you have debug logging enabled?</p>



<a name="228618719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228618719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228618719">(Mar 03 2021 at 16:11)</a>:</h4>
<p><code>debug-logging = true</code> in config.toml</p>



<a name="228618771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228618771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228618771">(Mar 03 2021 at 16:11)</a>:</h4>
<p>it should warn you if you have a log level that's ignored</p>



<a name="228618812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228618812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228618812">(Mar 03 2021 at 16:11)</a>:</h4>
<p>Yep</p>



<a name="228618870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228618870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228618870">(Mar 03 2021 at 16:11)</a>:</h4>
<p>Again, I do see the functions I'm interested in <em>elsewhere</em> in the log</p>



<a name="228763366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228763366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tm <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228763366">(Mar 04 2021 at 12:31)</a>:</h4>
<p>One possibility is cached output from cargo, which is quite confusing when it happens, but otherwise no idea what could be going on.</p>



<a name="228776708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228776708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228776708">(Mar 04 2021 at 14:02)</a>:</h4>
<p>Oh that reminds me I have a fix for cached output, it only works for RUSTC_LOG though</p>



<a name="228776852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228776852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228776852">(Mar 04 2021 at 14:03)</a>:</h4>
<p><a href="https://github.com/rust-lang/cargo/issues/8374#issuecomment-789810202">https://github.com/rust-lang/cargo/issues/8374#issuecomment-789810202</a></p>



<a name="228777074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228777074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228777074">(Mar 04 2021 at 14:04)</a>:</h4>
<p>The current solution is way over engineered to work for arbitrary env vars, but it doesn't work for them anyway, so there's not much point</p>



<a name="228780205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228780205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228780205">(Mar 04 2021 at 14:23)</a>:</h4>
<p>This happens when running the rustc binary by itself</p>



<a name="228780317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228780317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228780317">(Mar 04 2021 at 14:24)</a>:</h4>
<p>But when I have seen it before (or at least assuming I did), I've also seen it when running through cargo</p>



<a name="228780671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228780671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228780671">(Mar 04 2021 at 14:26)</a>:</h4>
<p>But I guess that this doesn't matter if there's something in the build artifacts</p>



<a name="228781006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228781006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228781006">(Mar 04 2021 at 14:28)</a>:</h4>
<p>I wonder if some file has the tracing output statically turned off, then when other files are recompiled incrementally, there are still files with the tracing output still statically turned off</p>



<a name="228781058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228781058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228781058">(Mar 04 2021 at 14:28)</a>:</h4>
<p>hmm I would expect setting <code>debug-logging = true</code> to recompile everything</p>



<a name="228781070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228781070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228781070">(Mar 04 2021 at 14:28)</a>:</h4>
<p>but maybe it doesn't?</p>



<a name="228781150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228781150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228781150">(Mar 04 2021 at 14:29)</a>:</h4>
<p>You mean, you would expect setting that to turn off incremental compilation?</p>



<a name="228781484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228781484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228781484">(Mar 04 2021 at 14:31)</a>:</h4>
<p>no, I would expect it to behave the same as <code>touch compiler/rustc_data_structures/lib.rs</code> or something, where bootstrap recompiles all the crates</p>



<a name="228781968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228781968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228781968">(Mar 04 2021 at 14:33)</a>:</h4>
<p>hmm</p>



<a name="228787501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Missing%20tracing%20subtrees%3F/near/228787501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Missing.20tracing.20subtrees.3F.html#228787501">(Mar 04 2021 at 15:05)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Missing.20tracing.20subtrees.3F/near/228776708">said</a>:</p>
<blockquote>
<p>Oh that reminds me I have a fix for cached output, it only works for RUSTC_LOG though</p>
</blockquote>
<p><a href="https://github.com/rust-lang/rust/pull/82763">https://github.com/rust-lang/rust/pull/82763</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>